<div class="swiper-container">
	<div class="swiper-wrapper">
		<?php foreach ($this->banner_list as $banner) :?>
		<div class="swiper-slide"> 
			<a href="/product/detail/id/<?php echo $banner["id"]?>"><img ismap src="<?php echo $banner["poster"]?>"></a>
		</div>
		<?php endforeach;?>
	<!--Etc..-->
	</div>
</div>
<div class="swiper-scrollbar"></div> 
<div class="maincontent">
	<h2><?php echo $this->arrParam['page_category'] ?></h2>
	<?php foreach($this->product_list as $product):?>
	<div class="list-product">
		<div class="icon-warper">
			<a href="/product/detail/id/<?php echo $product['id']?>">
				<img src="<?php echo $product["icon"]?>" title="<?php echo $product["name"]?> icon" alt="<?php echo $product["name"]?> icon">
			</a>
		</div>
		<div class="download">
			<ul>
				<li><img alt="" src="/images/icons/icon-luot-tai.png"> <?php echo $product["download"]?></li>
				<li><img alt="" src="/images/icons/heart-chon.png" style="margin-left: 4px;"> <?php echo ($product["vote"] == 0)?"3":number_format($product['vote_value']/$product['vote'],1)?></li>
			</ul>
		</div>
		<div class="clearfix"></div>
		<div class="info-warper">
			<a href="/product/detail/id/<?php echo $product['id']?>">
				<span class="title"><?php echo $product["name"]?></span>
				<span class="developer"><?php echo $product["developer"]?></span>
			</a>
		</div>
	</div>
	<?php endforeach;?>
</div>
<?php if (isset($this->arrParam['order'])) :?>
	<?php echo $this->formHidden("order",$this->arrParam['order'])?>
<?php else :?>
		<?php echo $this->formHidden("order","id")?>
<?php endif;?>
<script type="text/javascript">
<!--
var more = true;
var page = 2;
window.onload = function() {
	var swiper = new Swiper('.swiper-container', {
	    //Scrollbar:
	    scrollbar: {
	        container : '.swiper-scrollbar',
	        draggable : true,
	        hide: false,
	        snapOnRelease: true
	    }
	});
}
$(function() {
	$(window).bottom({proximity: 0});
	$(window).on('bottom', function() {
		if(more){
			$.ajax({
				type: "POST",
				url: "/product/more",
				data: {page: page,order:$("#order").val()},
				success: function(data){
					if(data != ""){
						$(".maincontent").append(data);
						page++;	
					}else{
						more = false;
					}
				}
			});
		}
	}); 
});
(function($) {
	$.fn.bottom = function(options) {
		var defaults = {proximity: 0};
		var options = $.extend(defaults, options);
		return this.each(function() {
			var obj = this;
			$(obj).bind("scroll", function() {
				if (obj == window) {
					scrollHeight = $(document).height();
				}else {
					scrollHeight = $(obj)[0].scrollHeight;
				}
				scrollPosition = $(obj).height() + $(obj).scrollTop();
				if ((scrollHeight - scrollPosition) / scrollHeight <= options.proximity) {
					$(obj).trigger("bottom");
				}
			});
			return false;
		});
	};
})(jQuery); 
//-->
</script>